﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace tiDE.SourceInsight
{
    public interface ISourceInsightProvider
    {
        string[] SupportedFileTypes
        {
            get;
        }

        /// <summary>
        /// Retrieves a list of source locations to populate the
        /// file's internal locations within the Solution Explorer
        /// </summary>
        List<SourceLocation> GetSourceLocations(string Source, string SourceFile);

        /// <summary>
        /// Converts a bitmap file to source code
        /// </summary>
        string BitmapToSource(Bitmap Bitmap, int numLevels);

        /// <summary>
        /// Converts a string of source code into an
        /// image, the reverse of BitmapToSource
        /// </summary>
        /// <param name="Source"></param>
        /// <returns></returns>
        Bitmap SourceToBitmap(string Source, int numLevelsGray, int Width, int Height);
    }

    public struct SourceLocation
    {
        public int Line, Index, Length;
        public string Name;

        public SourceLocation(int Line, int Index, int Length, string Name)
        {
            this.Line = Line;
            this.Index = Index;
            this.Name = Name;
            this.Length = Length;
        }
    }
}
